package com.xl.dao;

import com.xl.domain.entity.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 用户信息持久化操作对象
 */
@Repository
public interface UserRepository extends JpaRepository<UserEntity,Long> {


    /**
     * 登录方法
     * @param username 用户名
     * @param password 密码
     * @return
     */
    @Query(value="from UserEntity  o where o.username=:username and o.password=:password")
    UserEntity queryLogin(@Param("username") String username, @Param("password") String password);
}
